home *** CD-ROM | disk | FTP | other *** search
/ Complete Linux / Complete Linux.iso / docs / apps / tex / lametex_.z / lametex_ / lametex / src / Counter.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-09-02  |  1.3 KB  |  57 lines

  1. /* Counter.h
  2.  *
  3.  * LameTeX needs to keep track of a number of counters, just like LaTeX does,
  4.  * for things like tables, footnotes, chapters and sections, and enumerations.
  5.  * Since all counters need to be handled in much the same way, the Counter
  6.  * derived class under the Parameters class has been defined.
  7.  *
  8.  * Copyright 1992 Jonathan Monsarrat. Permission given to freely distribute,
  9.  * edit and use as long as this copyright statement remains intact.
  10.  *
  11.  */
  12.  
  13. class Counter : public Param {
  14.  public:
  15.    enum CounterType {   // The official LaTeX counters. All start at zero.
  16.       Part,
  17.       Chapter,
  18.       Section,
  19.       Subsection,
  20.       Subsubsection,
  21.       Paragraph,
  22.       Subparagraph,
  23.       Page,
  24.       Equation,
  25.       Figure,
  26.       Table,
  27.       Footnote,
  28.       Mpfootnote,
  29.       Description,
  30.       Enum,
  31.       Enumi,
  32.       Enumii,
  33.       Enumiii,
  34.       Enumiv,
  35.       Itemize,
  36.       Item,
  37.       LastType
  38.    };
  39.  
  40.    Counter();
  41.    Counter(Counter *);
  42.    Param *copy();
  43.    int set(int, float, char*);
  44.    float get(int, char*);
  45.    void postscript_set(int);
  46.    void revert(Param *);
  47.    void downcase_roman(int, char*);
  48.    void upcase_roman(int, char*);
  49.    void arabic(int, char*);
  50.    void downcase_alpha(int, char*);
  51.    void upcase_alpha(int, char*);
  52.  private:
  53.    int counters[LastType];
  54.    void description();
  55. };
  56.  
  57.